package cn.pet.service.manage.service.impl;

import cn.pet.service.manage.entity.PetSubscribe;
import cn.pet.service.manage.entity.dto.SubscribeDTO;
import cn.pet.service.manage.entity.vo.SubscribeVO;
import cn.pet.service.manage.mapper.PetSubscribeMapper;
import cn.pet.service.manage.service.PetSubscribeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.github.pagehelper.PageHelper;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

/**
 * <p>
 * 预约服务信息 服务实现类
 * </p>
 *
 * @author 
 * @since 2023-02-11
 */
@Service
public class PetSubscribeServiceImpl extends ServiceImpl<PetSubscribeMapper, PetSubscribe> implements PetSubscribeService {

    @Resource
    private PetSubscribeMapper petSubscribeMapper;

    @Override
    public List<SubscribeVO> listByPage(SubscribeDTO subscribeDTO) {
        PageHelper.startPage(subscribeDTO.getPageNum(),subscribeDTO.getPageSize());
        return petSubscribeMapper.listByLimit(subscribeDTO);
    }

    @Override
    public SubscribeVO getDetailById(Integer id) {
        return petSubscribeMapper.queryById(id);
    }
}
